<template>
  <div>
    <h1>sonA</h1>
    <button @click="btn">给10</button>
  </div>
</template>

<script>
import PubSub from "pubsub-js";
export default {
  // 发布
  methods: {
    btn() {
      PubSub.publish("giveMe", "10");
    },
  },
};
</script>

<style lang="scss" scoped>
</style>